package jedis;

import java.util.Set;

import redis.clients.jedis.Jedis;

public class JedisSimple {
	public static final String HOST = "192.168.142.134";

	public static void main(String[] args) {
		
		new Thread(new Runnable() {
			@Override
			public void run() {
				simpleJedisConnect();
			}
		}).start();
		
		new Thread(new Runnable() {
			@Override
			public void run() {
				simpleJedisConnect();
			}
		}).start();
	}
	
	public static void simpleJedisConnect() {
		Jedis jedis = new Jedis(HOST, 6379);
		Set<String> keys = jedis.keys("*");
		for(String key:keys) {
			System.out.println(key);
			try {
				Thread.sleep(10000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println(jedis.get(key));
		}
	}
}
